home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / center2g / frmperfe.frm next >
Text File  |  1999-09-01  |  8KB  |  224 lines

  1. VERSION 5.00
  2. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
  3. Begin VB.Form frmPerfExplorer 
  4.    Caption         =   "Winnt Performance Monitor"
  5.    ClientHeight    =   5085
  6.    ClientLeft      =   1905
  7.    ClientTop       =   1620
  8.    ClientWidth     =   7290
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   5085
  11.    ScaleWidth      =   7290
  12.    Begin ComctlLib.StatusBar StatusBar 
  13.       Align           =   2  'Align Bottom
  14.       Height          =   315
  15.       Left            =   0
  16.       TabIndex        =   1
  17.       Top             =   4770
  18.       Width           =   7290
  19.       _ExtentX        =   12859
  20.       _ExtentY        =   556
  21.       Style           =   1
  22.       SimpleText      =   ""
  23.       _Version        =   327682
  24.       BeginProperty Panels {0713E89E-850A-101B-AFC0-4210102A8DA7} 
  25.       EndProperty
  26.    End
  27.    Begin VB.Timer SampleTimer 
  28.       Enabled         =   0   'False
  29.       Interval        =   2000
  30.       Left            =   7500
  31.       Top             =   720
  32.    End
  33.    Begin ComctlLib.ListView ListView 
  34.       Height          =   4755
  35.       Left            =   0
  36.       TabIndex        =   0
  37.       Top             =   0
  38.       Width           =   7275
  39.       _ExtentX        =   12832
  40.       _ExtentY        =   8387
  41.       View            =   3
  42.       LabelEdit       =   1
  43.       LabelWrap       =   -1  'True
  44.       HideSelection   =   0   'False
  45.       _Version        =   327682
  46.       Icons           =   "ImageList"
  47.       SmallIcons      =   "ImageList"
  48.       ForeColor       =   -2147483640
  49.       BackColor       =   -2147483643
  50.       Appearance      =   1
  51.       NumItems        =   17
  52.       BeginProperty ColumnHeader(1) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
  53.          Key             =   ""
  54.          Object.Tag             =   ""
  55.          Text            =   "Computer"
  56.          Object.Width           =   2540
  57.       EndProperty
  58.       BeginProperty ColumnHeader(2) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
  59.          Alignment       =   1
  60.          SubItemIndex    =   1
  61.          Key             =   ""
  62.          Object.Tag             =   ""
  63.          Text            =   "Processor"
  64.          Object.Width           =   2540
  65.       EndProperty
  66.       BeginProperty ColumnHeader(3) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
  67.          Alignment       =   1
  68.          SubItemIndex    =   2
  69.          Key             =   ""
  70.          Object.Tag             =   ""
  71.          Text            =   "Memory"
  72.          Object.Width           =   2540
  73.       EndProperty
  74.       BeginProperty ColumnHeader(4) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
  75.          Alignment       =   1
  76.          SubItemIndex    =   3
  77.          Key             =   ""
  78.          Object.Tag             =   ""
  79.          Text            =   "Up Time"
  80.          Object.Width           =   2540
  81.       EndProperty
  82.       BeginProperty ColumnHeader(5) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
  83.          SubItemIndex    =   4
  84.          Key             =   ""
  85.          Object.Tag             =   ""
  86.          Text            =   "5"
  87.          Object.Width           =   2540
  88.       EndProperty
  89.       BeginProperty ColumnHeader(6) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
  90.          SubItemIndex    =   5
  91.          Key             =   ""
  92.          Object.Tag             =   ""
  93.          Text            =   "6"
  94.          Object.Width           =   2540
  95.       EndProperty
  96.       BeginProperty ColumnHeader(7) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
  97.          SubItemIndex    =   6
  98.          Key             =   ""
  99.          Object.Tag             =   ""
  100.          Text            =   "7"
  101.          Object.Width           =   2540
  102.       EndProperty
  103.       BeginProperty ColumnHeader(8) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
  104.          SubItemIndex    =   7
  105.          Key             =   ""
  106.          Object.Tag             =   ""
  107.          Text            =   "8"
  108.          Object.Width           =   2540
  109.       EndProperty
  110.       BeginProperty ColumnHeader(9) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
  111.          SubItemIndex    =   8
  112.          Key             =   ""
  113.          Object.Tag             =   ""
  114.          Text            =   "9"
  115.          Object.Width           =   2540
  116.       EndProperty
  117.       BeginProperty ColumnHeader(10) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
  118.          SubItemIndex    =   9
  119.          Key             =   ""
  120.          Object.Tag             =   ""
  121.          Text            =   "10"
  122.          Object.Width           =   2540
  123.       EndProperty
  124.       BeginProperty ColumnHeader(11) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
  125.          SubItemIndex    =   10
  126.          Key             =   ""
  127.          Object.Tag             =   ""
  128.          Text            =   "11"
  129.          Object.Width           =   2540
  130.       EndProperty
  131.       BeginProperty ColumnHeader(12) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
  132.          SubItemIndex    =   11
  133.          Key             =   ""
  134.          Object.Tag             =   ""
  135.          Text            =   "12"
  136.          Object.Width           =   2540
  137.       EndProperty
  138.       BeginProperty ColumnHeader(13) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
  139.          SubItemIndex    =   12
  140.          Key             =   ""
  141.          Object.Tag             =   ""
  142.          Text            =   "13"
  143.          Object.Width           =   2540
  144.       EndProperty
  145.       BeginProperty ColumnHeader(14) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
  146.          SubItemIndex    =   13
  147.          Key             =   ""
  148.          Object.Tag             =   ""
  149.          Text            =   "141"
  150.          Object.Width           =   2540
  151.       EndProperty
  152.       BeginProperty ColumnHeader(15) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
  153.          SubItemIndex    =   14
  154.          Key             =   ""
  155.          Object.Tag             =   ""
  156.          Text            =   "15"
  157.          Object.Width           =   2540
  158.       EndProperty
  159.       BeginProperty ColumnHeader(16) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
  160.          SubItemIndex    =   15
  161.          Key             =   ""
  162.          Object.Tag             =   ""
  163.          Text            =   "16"
  164.          Object.Width           =   2540
  165.       EndProperty
  166.       BeginProperty ColumnHeader(17) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
  167.          SubItemIndex    =   16
  168.          Key             =   ""
  169.          Object.Tag             =   ""
  170.          Text            =   "17"
  171.          Object.Width           =   2540
  172.       EndProperty
  173.    End
  174. End
  175. Attribute VB_Name = "frmPerfExplorer"
  176. Attribute VB_GlobalNameSpace = False
  177. Attribute VB_Creatable = False
  178. Attribute VB_PredeclaredId = True
  179. Attribute VB_Exposed = False
  180. Option Explicit
  181.  
  182. Private mbMoving As Boolean
  183. Const sglSplitLimit = 500
  184.  
  185. Private Sub Form_Resize()
  186.     ListView.Move 0, 0, Me.ScaleWidth, Abs(Me.ScaleHeight - StatusBar.Height - 30)
  187. End Sub
  188.  
  189. Private Sub Form_Load()
  190.     Me.Show
  191.  
  192.     Set List = ListView
  193.  
  194.     If PdhOpen Then
  195.         AddComputer "10.237.169.91"
  196.         'AddComputer "ComputerName 2"
  197.         'AddComputer "ComputerName 3"
  198.         'AddComputer "ComputerName n"
  199.  
  200.         SampleTimer.Enabled = True
  201.     Else
  202.         MsgBox "Error opening PDH: " & PdhLastError
  203.     End If
  204. End Sub
  205.  
  206.  
  207. Private Sub Form_Unload(Cancel As Integer)
  208.     SampleTimer.Enabled = False
  209.     DoEvents
  210.     
  211.     If Not PdhClose Then
  212.         MsgBox "Error closing PDH: " & PdhLastError
  213.     End If
  214.     
  215.     End
  216. End Sub
  217.  
  218.  
  219. Private Sub SampleTimer_Timer()
  220.     Call TakeSample
  221. End Sub
  222.  
  223.  
  224.